#pragma once

template <typename T>
class ScopedLock
{
public:
	explicit ScopedLock(T& t): t_(t)
	{
		t_.Lock();
	}
	~ScopedLock()
	{
		t_.Unlock();
	}
private:
	ScopedLock(const ScopedLock&);
	ScopedLock& operator = (const ScopedLock&);
	T& t_;
};

